#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@file: 7.定时器.py
@author: lyndon
@time: Created on 2021-01-21 9:25
@env: Python
@desc:
@ref:
@blog:
"""
import time
from threading import Timer


def func():
    print('时间同步' + time.strftime("%Y-%m-%d %H:%M:%S"))


while True:
    t = Timer(2, func).start()
    time.sleep(2)
